//
//  Case.m
//  Full_House
//
//  Created by 张忱 on 15-6-3.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "Case.h"

@implementation Case

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

- (void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@"commentNum"]) {
        
        self.commentNum = [value description];
        
    } else if ([key isEqualToString:@"likeNum"]) {
        
        self.likeNum = [value description];
        
    } else if ([key isEqualToString:@"coverPhoto"]) {
        
        self.coverPhoto = [value description];
        
    } else {
        [super setValue:value forKey:key];
    }
}

+ (NSMutableArray *)modelArrWithDics:(NSMutableArray *)dicarr
{
    NSMutableArray *arr = [NSMutableArray array];
    
    for (NSDictionary *dic in dicarr) {
        
        Case *case1 = [[Case alloc] init];
        
        [case1 setValuesForKeysWithDictionary:dic];
        
        [arr addObject:case1];
    }
    
    return arr;
}

- (void)dealloc
{
    [_likeNum release];
    [_commentNum release];
    [_coverPhoto release];
    [_title release];
    [_user release];
    [_date release];
    [super dealloc];
}

@end
